<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>bootstrap datatable demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">




<link rel="stylesheet" type="text/css"
	href="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/bootstrap.min.css">
<link rel="stylesheet" type="text/css"
	href="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/bootstrap-responsiv.css">


<link rel="stylesheet" type="text/css"
	href="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/dataTables.bootstra.css">
</head>

<body>

	<div class="container-fluid">
		<div class="row-fluid">

			<div>
				<ul class="breadcrumb">
					<li>房屋信息管理 <span class="divider">></span>
					</li>
					<li>房屋信息查看</li>
				</ul>
			</div>
			<div>
			<form id="searchForm" name="searchForm" class="form-horizontal bui-form-horizontal bui-form bui-form-field-container" style="outline: none;" aria-disabled="false" method="post" 
					action="<%=path %>/rest/tenement/addTenement" 
					aria-pressed="false" enctype="multipart/form-data">
					<input style="margin-left: 100px" type="file" name="ufile" id="ufile" />
					<input type="button" id="queryBtn"  class="btn btn-success"  value="上传房屋信息" />&nbsp;&nbsp;&nbsp;
					<font color="red">* 上传文件的后缀名必须为.xls</font>
					</form>
			</div>
		</div>
		<div class="row-fluid">

			<table
				class="table table-striped table-bordered table-hover datatable">
				<thead>
					<tr>
						<c:set value="${fn:split(pageModel.th_list,',') }" var="ths"></c:set>
						<c:forEach items="${ths }" var="th">
							<th>${th }</th>
						</c:forEach>
					</tr>
				</thead>
				<tbody>
					<!-- 数据信息 -->
					<c:forEach items="${list}" var="tds" varStatus="status">
						<tr class="odd gradeX">
							<td>${status.index + 1}</td>
							<td>${tds.tDong }栋</td>
							<td>${tds.tUnit }单元</td>
							<td>${tds.tNum }</td>
							<td>${tds.tArea }平方米</td>
							<td>${tds.owner.oName }</td>
							<td>${tds.owner.oTell }</td>
							<c:if test="${ empty tds.oIdcard }">
								<td><font color="green">空闲</font></td>
								<td><a href="<%=path %>/rest/tenement/deleteTenement?tid=${tds.tId }">删除</a></td>							
							</c:if>
							<c:if test="${not empty tds.oIdcard }">
								<td>在住</td>
								<td><a href="<%=path %>/rest/tenement/leaveTenement?tid=${tds.tId }">办理离住</a></td>
							</c:if>				
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
		<script type="text/javascript"
			src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/jquery.js"></script>
		<script type="text/javascript"
			src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/jquery.dataTables.js"></script>
		<script type="text/javascript"
			src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/bootstrap.min.js"></script>
		<script type="text/javascript"
			src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/dataTables.bootstrap.js"></script>
	</div>
	<script type="text/javascript">
		$(document).ready(function() {
    			$('.datatable').dataTable( {        				
        				"oLanguage": {
								"sUrl": "<%=path%>/json/zh_CN.json"
				}
			});
		});
		$("#queryBtn").click(
		        function(){
		            var s=document.searchForm.ufile.value; 
		            if(s==""){
		                alert("请选择文件！");
		                document.searchForm.ufile.focus();
		                return;
		            }
		            document.searchForm.submit();
		        }
		    );
	</script>
</body>

</html>
